public class Main {
    public static void main(String[] args) {
        String s = "abcdEFG";
        char cf = s.charAt(0);
        char cl = s.charAt(s.length()-1);
        System.out.println(cf);
        System.out.println(cl);
    }

}
